<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<!doctype html>
<html>

<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>LHL官方旗舰店</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css"
          type="text/css"/>
    <script src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js"
            type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"
            type="text/javascript"></script>
    <!-- 引入自定义css文件 style.css -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css"/>

    <style>
        body {
            margin-top: 20px;
            margin: 0 auto;
            width: 100%;
        }

        .carousel-inner .item img {
            width: 100%;
            height: 300px;
        }
    </style>
</head>

<body>
<jsp:include page="head.jsp"/>
<h1 align="center">限购限量---先到先得</h1>
<div class="row" style="width:1210px;margin:0 auto;">
    <c:forEach items="${requestScope.page.list}" var="pd">
        <div class="col-md-2">
            <a href="${pageContext.request.contextPath}/product/productInfo.do?pid=${pd.pid}">
                <img src="${pageContext.request.contextPath}/${pd.image}" width="170" height="170"
                     style="display: inline-block;">
            </a>
            <p class="text-center"><a
                    href="${pageContext.request.contextPath}/product/productInfo.do?pid=${pd.pid}"
                    style='color:green'>${fn:substring(pd.name, 0, 12)}</a></p>
            <p class="text-center"><font color="#FF0000">商城价：&yen;${pd.shopPrice}</font></p>
            <p class="text-center"><font color="#bc8f8f">商品剩余：${pd.skillCount}</font></p>
        </div>
    </c:forEach>

</div>
<h3 align="center">
    <ul class="pagination">
        <c:if test="${requestScope.page.pageIndex!=0}">
            <li>
                <a href="/product/findProductByFlag.do?flag=${requestScope.flag}&pageId=${requestScope.page.pageIndex-1}"
                   aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
        </c:if>
        <c:if test="${requestScope.page.pageIndex==0}">
            <li>
                <a href="#" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
        </c:if>

        <c:forEach begin="${requestScope.page.start}" end="${requestScope.page.end}" var="i" step="1">
            <c:if test="${requestScope.page.pageIndex==i}">
                <li class="active"><a
                        href="/product/findProductByFlag.do?flag=${requestScope.flag}&pageId=${i}">${i+1}</a>
                </li>
            </c:if>
            <c:if test="${requestScope.page.pageIndex!=i}">
                <li><a href="/product/findProductByFlag.do?flag=${requestScope.flag}&pageId=${i}">${i+1}</a>
                </li>
            </c:if>
        </c:forEach>

        <c:if test="${requestScope.page.pageIndex!=requestScope.page.pageTotal}">
            <li>
                <a href="/product/findProductByFlag.do?flag=${requestScope.flag}&pageId=${requestScope.page.pageIndex+1}"
                   aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </c:if>
        <c:if test="${requestScope.page.pageIndex==requestScope.page.pageTotal}">
            <li>
                <a href="#" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </c:if>
    </ul>
</h3>
<!--PageHelper-->
<%--<h3 align="center">--%>
<%--<ul class="pagination">--%>
<%--<c:if test="${requestScope.page.pageNum!=1}">--%>
<%--<li>--%>
<%--<a href="${pageContext.request.contextPath}/product/findProductByCid.do?cid=${requestScope.cid}&pageId=${requestScope.page.pageNum-1}" aria-label="Previous">--%>
<%--<span aria-hidden="true">&laquo;</span>--%>
<%--</a>--%>
<%--</li>--%>
<%--</c:if>--%>
<%--<c:if test="${requestScope.page.pageNum==1}">--%>
<%--<li>--%>
<%--<a href="#" aria-label="Previous">--%>
<%--<span aria-hidden="true">&laquo;</span>--%>
<%--</a>--%>
<%--</li>--%>
<%--</c:if>--%>
<%--<!----%>
<%--navigateFirstPage    start--%>
<%--navigateLastPage     end--%>
<%---->--%>
<%--<c:forEach begin="${requestScope.page.navigateFirstPage}" end="${requestScope.page.navigateLastPage}" var="i" step="1">--%>
<%--<c:if test="${requestScope.page.pageNum==i}">--%>
<%--<li class="active"><a href="${pageContext.request.contextPath}/product/findProductByCid.do?cid=${requestScope.cid}&?pageId=${i}">${i}</a></li>--%>
<%--</c:if>--%>
<%--<c:if test="${requestScope.page.pageNum!=i}">--%>
<%--<li><a href="${pageContext.request.contextPath}/product/findProductByCid.do?cid=${requestScope.cid}&pageId=${i}">${i}</a></li>--%>
<%--</c:if>--%>
<%--</c:forEach>--%>

<%--<c:if test="${requestScope.page.pageNum!=requestScope.page.pages}">--%>
<%--<li>--%>
<%--<a href="${pageContext.request.contextPath}/product/findProductByCid.do?cid=${requestScope.cid}&pageId=${requestScope.page.nextPage}" aria-label="Next">--%>
<%--<span aria-hidden="true">&raquo;</span>--%>
<%--</a>--%>
<%--</li>--%>
<%--</c:if>--%>
<%--<c:if test="${requestScope.page.pageNum==requestScope.page.pages}">--%>
<%--<li>--%>
<%--<a href="#" aria-label="Next">--%>
<%--<span aria-hidden="true">&raquo;</span>--%>
<%--</a>--%>
<%--</li>--%>
<%--</c:if>--%>
<%--</ul>--%>
<%--</h3>--%>


<jsp:include page="history.jsp"/>
<jsp:include page="foot.jsp"/>
</body>

</html>